package com.kitty.game.fight.bean;

import com.kitty.game.boss.config.BossSet;
import com.kitty.game.boss.model.BossParam;
import com.kitty.game.boss.model.SuperBossParam;
import com.kitty.game.fight.ai.RoundSkillChooser;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;
//后加
import com.kitty.game.fight.ai.SkillChooser;
import com.kitty.game.fight.bean.BossFightObject;
import com.kitty.game.fight.bean.FightObject;

/**超级boss*/
@Getter
@Setter
public class SuperBossFightObject extends BossFightObject {
    /**拥有法宝*/
    private Map<String, Integer> artifactMap = new HashMap<>();
    /**定海珠触发回合*/
    private int pearlRound;

    public SuperBossFightObject(BossSet bossSet, BossParam bossParam, Short pos, int monsterId, short level) {
        super(bossSet, bossParam, pos, monsterId, level);
        if (bossParam.isSuperBoss()) {
            SuperBossParam superBossParam = (SuperBossParam)bossParam;
            RoundSkillChooser skillChooser = new RoundSkillChooser();
            skillChooser.setRoundSkills(superBossParam.getRoundSkills());
            skillChooser.setNormalSkills(superBossParam.getSkillIds());

            setSkillChooser(skillChooser);

            artifactMap = superBossParam.getArtifactMap();
        }
    }

    /**是否拥有法宝*/
    public boolean hasArtifact(String name) {
        return artifactMap != null && artifactMap.containsKey(name);
    }

    /**获得法宝对应的等级*/
    public int queryArtifactLevel(String name) {
        if (artifactMap != null && artifactMap.containsKey(name)) {
            return artifactMap.get(name);
        }

        return 0;
    }

    @Override
    public int getPhyHurt(FightObject target, boolean isPenetrate) {
        return getPhyHurt(target, isPenetrate, 0.4);
    }

    @Override
    public int getMagHurt(FightObject target, boolean isPenetrate) {
        return getMagHurt(target, isPenetrate, 0.4);
    }
}
